#ifndef DSPSIMULATOR_REGISTERMAP_H
#define DSPSIMULATOR_REGISTERMAP_H

#include <unordered_map>
#include <string>
#include <memory>
#include "simulator/targetMachine/register.h"
#include "simulator/type/type.h"

namespace simulator {
    class RegisterMap {
    protected:
        std::unordered_map<std::string, std::shared_ptr<Register<u16>>> m_reg16_map;
        std::unordered_map<std::string, std::shared_ptr<Register<u32>>> m_reg32_map;
        std::unordered_map<std::string, std::shared_ptr<Register<u64>>> m_reg64_map;
    public:
        RegisterMap() = default;

        RegisterMap(const RegisterMap &registerMap);

        ~RegisterMap() = default;

        bool add_reg16(const std::shared_ptr<Register<u16>>& reg);

        bool add_reg32(const std::shared_ptr<Register<u32>>& reg);

        bool add_reg64(const std::shared_ptr<Register<u64>>& reg);

        std::shared_ptr<Register<u16>> get_reg16(const std::string &reg_name) const;

        std::shared_ptr<Register<u32>> get_reg32(const std::string &reg_name) const;

        std::shared_ptr<Register<u64>> get_reg64(const std::string &reg_name) const;
    };
}

#endif //DSPSIMULATOR_REGISTERMAP_H
